package com.jt.mapper;

import com.jt.pojo.User;
import org.apache.ibatis.annotations.*;

import java.util.List;

public interface UserMapper {
    @Select("select * from user where username=#{username} and password=#{password}")
    User selectUserByUP(User user);
    @Select("select count(1) from user")//统计记录
    long findTotal();
    //将多值封装为对象/list/map
    List<User> findUserByPage(@Param("start") int start,@Param("size") int size,@Param("query") String query);
    @Update("update user set status = #{status} where id = #{id}")
    void updateStatusById(User user);

    void addUser(User user);
    @Select("select * from user where id = #{id}")
    User findUserById(Integer id);
    @Update("update user set phone = #{phone},email = #{email} where id = #{id}")
    void updateUserById(User user);
    @Delete("delete from user where id = #{id}")
    void deleteUserById(Integer id);
}
